package com.yimi.yinhepda.views.moveStock_module;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.yimi.yinhepda.R;
import com.pda.ym.base.BaseTitleActivity;
import com.yimi.yinhepda.views.load_module.LoadUnloadGroupActivity;
import com.yimi.yinhepda.views.moveStock_module.unload.MoveStockUnloadTaskActivity;

import org.jetbrains.annotations.NotNull;

/**
 * @author lj
 * Date: 2018/12/24
 * Description: 移库倒货主界面
 */
public class MoveStockActivity extends BaseTitleActivity {

    @Override
    public String getPageName() {
        return "移库倒货";
    }

    @Override
    public int setContentViewId() {
        return R.layout.activity_move_stock;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        findViewById(R.id.btn_moveStockLoad).setOnClickListener(this);
        findViewById(R.id.btn_moveStockUnload).setOnClickListener(this);
        findViewById(R.id.btn_moveStockUnloadSingle).setOnClickListener(this);
        findViewById(R.id.btn_moveStockCache).setOnClickListener(this);
        findViewById(R.id.btn_moveStockBack).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        Intent intent;
        switch (v.getId()) {
            case R.id.btn_moveStockLoad:
                //移库装车
                intent = new Intent(this, LoadUnloadGroupActivity.class);
                //扫描类型：1-装车扫描，2=卸车扫描 ,3-离线装车，4-离线卸车,5-移库装车，6-移库卸车，7-单独移库卸车
                intent.putExtra("scanType", 5);
                startActivity(intent);
                break;
            case R.id.btn_moveStockUnload:
                //移库卸车
                toActivity(MoveStockUnloadTaskActivity.class);
                break;
            case R.id.btn_moveStockUnloadSingle:
                //单独移库卸车
                intent = new Intent(this, LoadUnloadGroupActivity.class);
                //扫描类型：1-装车扫描，2=卸车扫描 ,3-离线装车，4-离线卸车,5-移库装车，6-移库卸车，7-单独移库卸车
                intent.putExtra("scanType", 7);
                startActivity(intent);
                break;
            case R.id.btn_moveStockCache:
                //移库任务暂存
                toActivity(MoveStockCacheActivity.class);
                break;
            case R.id.btn_moveStockBack:
                finish();
                break;
            default:
                break;
        }
    }

    @Override
    public boolean showBack() {
        return false;
    }

    @Override
    public void setBack() {

    }

    @NotNull
    @Override
    public String setTitle() {
        return getPageName();
    }

}
